1. Field of the Invention
The present invention relates to a moving picture compressing apparatus and a moving picture compressing method and in particular, to a moving picture compressing apparatus and a moving picture compressing method for compression-encoding a picture signal on real time basis corresponding to a compression-encoding system mainly using a discrete cosine transform (DCT) process and a quantizing process.
2. Description of the Prior Art
When picture information is digitized and transmitted to a communication medium such as a telephone line, it is transmitted after it is compressed and encoded since the data amount of the picture information is vast. When a picture is compressed, a DCT encoding system has been widely used. In the DCT encoding system, picture data is compressed using the characteristic that magnitudes of spatial frequencies thereof tend to concentrate on lower spatial frequencies. This system has been adopted in international standards such as MPEG (Moving Picture Experts Group) video and ITU-T Recommendation H.263.
FIGS. 9A, 9B, 9C, 9D, 9E, and 9F are schematic diagrams showing a hierarchy of code formats of MPEG video. FIG. 1A shows a video sequence as the top hierarchical level. The video sequence is composed of a plurality of GOPs (Group of Pictures). Each GOP is composed of a plurality of pictures as shown in FIG. 1B. Each picture represents one frame. Pictures are categorized into three types of pictures that are I picture, P picture, and B picture. The I picture is composed of only intra-frame codes. The P picture is composed of inter-frame codes in forward direction as well as intra-frame codes. The B picture is composed of inter-frame codes in both of forward and backward directions as well as intra-frame code.
Each picture is composed of a plurality of slices arbitrarily divided into areas as shown in FIG. 1C. Each slice is composed of a plurality of macro-blocks arranged rightwardly or downwardly. Macro-blocks are categorized as intra-blocks and inter-blocks. The intra-blocks are composed of intra-frame codes. The inter-blocks are composed of inter-frame codes in forward direction or two directions. The I picture is composed of only intra-blocks. On the other hand, the P picture and B picture are composed of inter-blocks as well as intra-blocks.
Each macro-block is composed of a total of six blocks that are luminance components (Y1, Y2, Y3, and Y4) and two color difference components (Cb and Cr) as shown in FIG. 1E. Each of the six blocks is composed of 8xc3x978 pixels. A block of 8xc3x978 pixels shown in FIG. 1F is the minimum encoding unit.
Next, with reference to FIG. 2, a conventional picture compressing process will be explained. FIG. 10 is a block diagram showing an example of the structure of a conventional picture compressing apparatus. In the apparatus shown in FIG. 10, central processing unit (CPU) 2 executes a program in apparatus controlling means 1 so as to control the whole of the apparatus. A user inputs a desired command to CPU 2 through keyboard 3. Picture data is compression-encoded by picture compressing means 4. The resultant compressed code is transmitted to a communication line.
Picture data is supplied to color converting means 5 in picture compressing means 4. Color converting means 5 converts the picture data into three types of data that are Y, Cr, and Cb (hereinafter referred to as YCrCb data as a whole). A motion estimating means 6 searches a macro-block in the preceding/following frame so that the difference between the macro-block and a macro-block in the current frame becomes the minimum and calculates a motion vector corresponding to the motion between he two macro-blocks. When the difference is small, predicting means 7 calculates the difference between the frames so as to perform the inter-frame compressing process.
Output data of motion estimating means 6 is supplied to DCT means 8 along with the output of predicting means 7. When the intra-frame compressing process is performed, DCT means 8 performs a DCT process for the YCrCb data. When the inter-frame compressing process is performed, DCT means 8 performs the DCT process for the difference data. Thereafter, quantizing means 9 quantizes the resultant data. Next, variable length code encoding means 10 encodes the resultant data into variable length code.
The quantized data that is outputted from quantizing means 9 is supplied to inversely quantizing means 14. Inversely quantizing means 14 inversely quantizes the quantized data. Inverse DCT means 13 performs an inverse DCT process for the resultant data. When the intra-frame compressing process is performed, the resultant data is stored in reference frame portion 11. When the inter-frame compressing process is performed, the difference in the inverse DCT process is added to the macro-block compensated in motion with the motion vector stored in reference frame portion 11. The resultant data is stored in reference frame portion 11.
The picture code that has been compression-encoded on the transmitting side is transmitted to the communication line. The picture to be transmitted need to be compressed in a compression ratio corresponding to the bit rate of the communication line. In particular, when picture data and audio data are transmitted at a low bit rate of 64 kbps used in a TV telephone system, they should be compressed at a high compression rate. Thus, the ratio of inter-frame compressed blocks to intra-frame compressed blocks is increased because code amount of an inter-frame compressed blocks is smaller than that of an intra-frame compressed block.
For example, in the first frame, all macro-blocks are compressed in the intra-frame compressing process. In the second or later frames, all the macro-blocks are compressed in the inter-frame compressing process unless the difference between different frames is large. Thus, the ratio of macro-blocks that are compressed in the intra-frame compressing process is decreased in second or later frames. However, when a scene change takes place, a code amount abruptly increases since the difference between different frames becomes large. Thus, it takes a long time to reproduce frames following a scene change on the reproducing side. Consequently, the picture looks like a still picture.
In order to solve such a problem, various picture compressing apparatuses that effectively compress pictures preceded by a scene change have been proposed in, for example, JPA-8-56361, JPA-2-174387, JPA-7-38895, and JPA-3-13792. In the picture compressing apparatus disclosed in JPA-8-56361, several consecutive frames preceded by a scene change including frames which are originally compressed in the intra-frame compressing process are forcedly compressed in the inter-frame compressing process, so that a code amount is decreased. In the picture compressing apparatus disclosed in JPA-2-174387, the intra-frame encoding process or the inter-frame prediction encoding process is used so that the prediction error becomes minimum and blocks are encoded using codebooks of which each is dedicated for intra-frame encoding process or the inter-frame prediction encoding. In the picture compressing apparatus disclosed in JPA-7-38895, after a scene change, higher-spatial-frequency components of blocks that are compressed in the intra-frame compressing process are deleted. In the picture compressing apparatus disclosed in JPA-3-13792, after a scene change due to a switching operation of a camera, picture data of several frames are sub-sample encoded so as to decrease a code amount generated.
Among the foregoing prior art references, in the picture compressing apparatus disclosed in JPA-8-56361, the ratio of macro-blocks that are compressed in the inter-frame encoding process is increased so as to transmit code at a low bit rate. But, the effect of decreasing a code amount is small. In addition, when data is compressed at a high compression rate in order to reduce a code amount, the picture quality deteriorates. The deteriorated picture does not recover its quality for a long time because it recovers its quality when all of the blocks has been compressed in the intra-frame compression process after deterioration. In the picture compressing apparatus disclosed in JPA-2-174387, the effect is low in case that the ratio of blocks that are compressed in the intra-frame compressing process is originally decreased. In the picture compressing apparatus disclosed in JPA-7-38895, since higher-spatial-frequency components are deleted, the picture quality deteriorates. And the deteriorated picture does not recover its quality until a frame of the picture is compressed in the intra-frame compression process. In the picture compressing apparatus disclosed in JPA-3-13792, a special decoding means is required on the reproducing side.
In order to overcome the aforementioned disadvantages, the present invention has been made and accordingly has an object to provide a picture compressing apparatus and a picture compressing method in which a code amount of a picture after a scene change is decreased and picture quality is quickly recovered after the scene change even at a low bit rate without need to use a special means on the reproducing side.
According to a first aspect of the present invention, there is provided a moving picture compression apparatus for performing intra-frame or inter-frame compression every block in frames in a moving picture, which comprises: means for detecting scene change in a moving picture; means for generating code containing information on components in a transformed domain""s range gradually extending as the picture advances for a block in a new scene portion of a frame at the scene change detection during plural frames from the frame at the scene change detection, wherein the information is obtained by compressing the block in the new scene portion with the intra-frame compression process in the first frame from the scene change detection, and the information is obtained by compressing the block in the new scene portion with the inter-frame compression process in the second and following frames from the scene change detection.
According to a second aspect of the present invention, there is provided a moving picture compression apparatus for performing intra-frame or inter-frame compression every block in frames of a moving picture, which comprises: transforming means for transforming data in space domain to data in transformed domain; inversely-transforming means for transforming the data in the transformed domain to data in the space domain; scene change detecting means for detecting scene change; a first storage for storing the data in the transformed domain; a second storage for storing data used as reference data; a first writing means for writing the data in the transformed domain to the first storage when the scene change is detected; invalidating means for invalidating a part of the data in the transformed domain when the scene change is detected; a second writing means for writing the data obtained by inversely converting data which remains valid among the data in the transformed domain to the second storage as reference data when the scene change is detected; replacing means for replacing data in a current block by replacement data obtained by reading a part of the data in the transformed domain in the first storage and inversely transforming the part of data by using the inversely-transforming means; difference data generating means for generating difference data by subtracting reference data read from the second storage from the replacement data and supplying the difference data to the transforming means; and updating means for updating reference data in the second storage memory by reading reference data from the second storage, adding the output of the inverse transform means to the read reference data to get sum data, and writing the sum data to the second reference storage; wherein the part of the data in the transformed domain read from the first storage by replacing means is increased in range as a picture advances.
The moving picture compression apparatus may further comprises: quantizing means for quantizing the data in the space domain; inversely quantizing means for inversely quantizing the quantized data in the transformed domain to obtain inversely quantized data in the transformed domain which is supplied to the inverse-transforming means; encoding means for coding the quantized data in the transformed domain.
The encoding means may generate a variable length code.
The transformed domain may be spatial frequency domain. According to a third aspect of the present invention, there is provided a moving picture compression method for performing intra-frame or inter-frame compression every block in frames in a moving picture, which comprises steps of: detecting scene change in a moving picture; generating code containing information on components in a transformed domain""s range gradually extending as the picture advances for a block in a new scene portion of a frame at the scene change detection during plural frames from the frame at the scene change detection, wherein the information is obtained by compressing the block in the new scene portion with the intra-frame compression process in the first frame from the scene change detection, and the information is obtained by compressing the block in the new scene portion with the inter-frame compression process in the second and following frames from the scene change detection.
These and other objects, features and advantages of the present invention will become more apparent in light of the following detailed description of the best mode embodiment thereof, as illustrated in the accompanying drawings.